let Controller = {
  mounted() {
    this.initData();
  },
  activated() {
    this.initData();
    this.getDetail();
  },
  methods: {
    initData() {
      const param = this.$route.query;
      this.Model.queryData = _.cloneDeep(param);
    },
    getFilterData(val) {
      this.Model.searchFromData = val;
		},
    onTableSelectionChange(val) {
      this.Model.exportTableSelectList = val;
    },
    onTabChange(val) {
      switch (val) {
        case 1:
          break;
        case 2:
          break;
        case 3:
          break;
      }
    },
    // 获取详情
    getDetail() {
      let id = this.$route.query.id
      this.$ajax.get(`${api.supplier}/whWarehouseArrival/detail/list/${id}`).then(res => {
        if(res.data.status === 200) {
          let data = res.data.result
          this.Model.filterOption.items.map(ele => {
            ele.data = data.warehouse[ele.key]
          })
          this.Model.tableData = data.detailList
        }
      }).catch(err => {

      })
    },
    toggleTableDetail() {}
    // requestDetail() {
    //   const param = {
    //     condition: {
    //       number: this.Model.queryData.number
    //     }
    //   };
    //   if (param) {
    //     this.$ajax.post(this.apiTest + `/supplier/whWarehouseDetail/outAndInDetails`, param)
    //       .then(response => {
    //         const data = response.data;
    //         if (data.status == 200) {
    //           const result = data.result;
    //           this.Model.detailData = result;
    //           this.Model.status = result.status;
    //           this.requestFilterData();
    //           this.setFilterData();
    //         }else{
    //           this.$message.error(data.msg)
    //         }

    //       })
    //       .catch(error => {
    //         this.$message.error('请求错误');
    //       });
    //   }
    // },
  }
}
export default Controller;
